< previous page page_83 next page >

Page 83
You may have noticed that each time a child form instance is created, it's placed in a different location within the parent. Actually, Windows places these forms onscreen by using a cascading windows effect, starting at the top left of the screen. To change this default placement and size, you need to place code in the load event of the child form to position and size it the way you want it.
Note
You can't change the
StartUpPosition property of the child form from its default to set the initial position of the form.

One of the easier features to include in an MDI application is the ability to allow users to arrange the child forms in the parent container. The key to this feature is the MDI form's Arrange method, which organizes all the child forms in one of four very familiar patterns. Table 3.2 lists each pattern that you can use.
TABLE 3.2. USING THEArrangeMETHOD SETTINGS.
ConstantDescription
vbCascadeArranges all the non-minimized forms behind one another, slightly offset to the right and down from the one behind it.
vbTileHorizontalEach form is shown side by side, occupying the full height of the parent.
vbTileVerticalEach form is displayed on top of each other, occupying the full width of the parent.
vbArrangeIconsThis setting arranges the icons of all minimized child forms.

To add this feature to the application, add a new menu option called Window and put four suboptions in it, as shown in Figure 3.12.
12181-0083a.gif
Figure 3.12.
Adding the automatic arrangement
processing to your MDI application.

 
< previous page page_83 next page >

If you like this book, buy it!